home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
SourceCode
/
AdobeExamples
/
NX_ImportAdv
/
epsfwraps.psw
< prev
next >
Wrap
Text File
|
1992-12-19
|
3KB
|
83 lines
/*
* (a) (C) 1990 by Adobe Systems Incorporated. All rights reserved.
*
* (b) If this Sample Code is distributed as part of the Display PostScript
* System Software Development Kit from Adobe Systems Incorporated,
* then this copy is designated as Development Software and its use is
* subject to the terms of the License Agreement attached to such Kit.
*
* (c) If this Sample Code is distributed independently, then the following
* terms apply:
*
* (d) This file may be freely copied and redistributed as long as:
* 1) Parts (a), (d), (e) and (f) continue to be included in the file,
* 2) If the file has been modified in any way, a notice of such
* modification is conspicuously indicated.
*
* (e) PostScript, Display PostScript, and Adobe are registered trademarks of
* Adobe Systems Incorporated.
*
* (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
* CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
* AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
* ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
* OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
* WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
* WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
* DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS.
*/
/*
* epsfwraps.psw
*
* Version: 2.0
* Author: Ken Fromm
* History:
* 03-07-91 Added this comment.
*/
/* Sets the state for inclusion. */
defineps PSWBeginEpsf()
/EPSFsave save def % Save state for cleanup
/EPSFcountdict countdictstack def % Count objects on dict stack
/EPSFcount count 1 sub def % Count objects on operand stack
userdict begin % Push userdict on dict stack
/showpage { } def % Redefine showpage, { } = null proc
0 setgray 0 setlinecap % Prepare graphics state
1 setlinewidth 0 setlinejoin
10 setmiterlimit [ ] 0 setdash newpath
/languagelevel where % If level not equal to 1 then
{pop languagelevel % set strokeadjust and
1 ne % overprint to their defaults
{false setstrokeadjust false setoverprint
} if
} if
endps
/* Resets the state after inclusion. */
defineps PSWEndEpsf()
count EPSFcount sub { pop} repeat % Clean up stacks
countdictstack EPSFcountdict sub {end} repeat
EPSFsave restore
endps
/*
* Positions the Epsf file within the document. The first four
* floats are the origin and size within the document. The next
* four are the original origin and size. The Angle is the
* amount of rotation in degrees.
*/
defineps PSWSetEpsf(float OriginX, OriginY, Width, Height,
OrigOriginX, OrigOriginY, OrigWidth, OrigHeight, Angle)
OriginX OriginY translate
Angle rotate
Width OrigWidth div Height OrigHeight div scale
OrigOriginX neg OrigOriginY neg translate
OrigOriginX OrigOriginY OrigWidth OrigHeight rectclip
endps